package org.flown.novel.data;

import com.baomidou.mybatisplus.annotation.*;

import lombok.Data;

@Data
@TableName("user")
public class User
{
    public enum Column
    {
        ID("id"),
        NICKNAME("nickname"),
        USERNAME("username"),
        PASSWORD("password"),
        LAST_LOGIN_TIME("last_login_time");

        private final String name;
        Column(String name){this.name = name;}
        public String getName(){return this.name;}
    }

    @TableId(value = "id", type = IdType.AUTO)
    private Integer id = 0;//从1开始
    private String nickname;
    private String username;
    private String password;

    @TableField(fill = FieldFill.INSERT, insertStrategy = FieldStrategy.IGNORED, updateStrategy = FieldStrategy.IGNORED)
    private java.util.Date registerTime = null;//会自动填充
    @TableField(insertStrategy = FieldStrategy.IGNORED, updateStrategy = FieldStrategy.IGNORED)
    private java.util.Date lastLoginTime;

    public String getKey()
    {
        return this.id + this.password + this.nickname + this.username;
    }
}


